package domain;

public class Rating {
	private int movieId;
	private int rate;

	public Rating(int movieId, int rate) {
		this.movieId = movieId;
		this.rate = rate;
	}

	public int getMovieId() {
		return movieId;
	}

	public void setMovieId(int movieId) throws Exception {
		if (movieId < 0) {
			throw (new Exception("MovieId incorrect!"));
		} else {
			this.movieId = movieId;
		}
	}

	public int getRate() {
		return rate;
	}

	public void setRate(int rate) throws Exception {
		if (rate < 0 || rate > 5) {
			throw (new Exception("Rate is incorrect!"));
		} else {
			this.rate = rate;
		}
	}


}
